//
//  BTXMPPTool.h
//  WeChat
//
//  Created by 互联网 on 16/11/1.
//  Copyright © 2016年 bigtree. All rights reserved.
// 工具类

#import <Foundation/Foundation.h>
#import "Singleton.h"
#import "XMPPFramework.h"

typedef enum
{
    XMPPResultTypeSuccess, // 登录成功
    XMPPResultTypeFailure,
    XMPPResultTypeRegisterSuccess,
    XMPPResultTypeRegisterFailure// 登录失败
    
} XMPPResultType;

/**
 *  与服务器交互的结果
 */
typedef void(^XMPPResultBlock)(XMPPResultType result);

@interface BTXMPPTool : NSObject
singleton_interface(BTXMPPTool)
@property (strong, nonatomic, readonly) XMPPStream *xmppStream; // 客户与服务器交互的核心类
@property (strong, nonatomic, readonly) XMPPvCardTempModule *vCard; // 电子名片模块
@property (strong, nonatomic, readonly) XMPPvCardCoreDataStorage *vCardStorage; // 电子名片数据存储

@property (strong, nonatomic, readonly) XMPPRoster *roster;    // 花名册模块
@property (strong, nonatomic, readonly) XMPPRosterCoreDataStorage *rosterDataStorage; //花名册数据存储
@property (strong, nonatomic, readonly)XMPPvCardAvatarModule *avatar; // 电子名片头像模块
@property (strong, nonatomic, readonly) XMPPMessageArchiving *msgArchiving;
@property (strong, nonatomic, readonly)XMPPMessageArchivingCoreDataStorage *msgArchivingStorage;


/**
 *  标识  连接服务器到底是“登录连接”还是“注册连接”
    NO  代表登录操作
    YES 代表注册操作
 */
@property (nonatomic,assign, getter=isRegisterOperation) BOOL registerOperation;

/**
 *  用户登录
 */
-(void)xmppLogin:(XMPPResultBlock) resultBlock;

/**
 *  用户注册
 */
-(void)xmppRegister:(XMPPResultBlock)resultBlock;

/**
 *  用户注销
 */
-(void)xmppLogout;

@end
